package com.zebra.remoting.connection;


import com.zebra.remoting.CommandHandler;
import com.zebra.remoting.RpcCodec;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;

/**
 * Factory that creates connections.
 */
public interface ConnectionFactory {

    /**
     * Initialize the factory.
     */
    void init();

    Channel connect(String targetIP, int targetPort, int connectTimeout) throws Exception;

    void registerRpcCodec(RpcCodec rpcCodec);

    void registerCommandHandler(CommandHandler commandHandler);

    void registerHeartbeatProcessor(ChannelHandler heatHandler);

    }
